package com.fishery.customization.service;

import com.fishery.customization.entity.OneLevelLabel;
import com.fishery.customization.entity.UserLabel;

import java.util.Collection;


public interface UserLabelService {

	/**
	 * 通过用户ID获取用户自定义后的Json标签
	 *
	 * @param userId
	 * @return
	 */
	String getCustomizedLabelsOfUserByUserId(String userId);


	/**
	 * 保存或修改用户自定义的标签
	 *
	 * @param userLabel
	 * @return
	 */
	boolean saveOrUpdateLabelsByUserIdAndBaseIdAndRole(UserLabel userLabel);


	/**
	 * 通过用户ID删除用户自定义的标签
	 *
	 * @param userId
	 * @return
	 */
	boolean removeLabelsByUserId(String userId);

	/**
	 * 通过基地Id修改基地角色名
	 *
	 * @param baseId
	 * @param oldName
	 * @param newName
	 * @return
	 */
	boolean updateBaseRoleNameByBaseId(String baseId, String oldName, String newName);

	/**
	 * 通过基地Id、角色对用户自定义标签进行修改
	 *
	 * @param baseId
	 * @param role
	 * @param addOneLevelLabels
	 * @param deleteOneLevelLabels
	 * @return
	 */
	boolean updateUserLabelsByBaseIdAndRole(String baseId, String role, Collection<OneLevelLabel> addOneLevelLabels, Collection<OneLevelLabel> deleteOneLevelLabels);

	/**
	 * 通过基地Id、排除角色名对用户自定义标签进行修改
	 *
	 * @param baseId
	 * @param exceptRole
	 * @param addOneLevelLabels
	 * @param deleteOneLevelLabels
	 * @return
	 */
	boolean updateOtherUsersLabelsOfBaseByBaseIdAndRole(String baseId, String exceptRole, Collection<OneLevelLabel> addOneLevelLabels, Collection<OneLevelLabel> deleteOneLevelLabels);
}

